package com.example.test.dialogfactory;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import easier.app.x.CommonCode;
import easier.log.logger.Logger;

public class MainActivity104 extends AppCompatActivity {

    private EditText mInput;
    private Button mCheckInput;

    public static void start( Context context ) {

        Intent starter = new Intent( context, MainActivity104.class );
        context.startActivity( starter );
    }

    @Override
    protected void onCreate( Bundle savedInstanceState ) {

        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main104 );
        initView();
    }

    private void initView() {

        mInput = findViewById( R.id.input );
        mInput.addTextChangedListener( new TextWatcher() {
            @Override
            public void beforeTextChanged( CharSequence s, int start, int count, int after ) {

            }

            @Override
            public void onTextChanged( CharSequence s, int start, int before, int count ) {

            }

            @Override
            public void afterTextChanged( Editable s ) {

            }
        } );
        mCheckInput = findViewById( R.id.checkInput );
        mCheckInput.setOnClickListener( new OnClickListener() {
            @Override
            public void onClick( View v ) {

                CharSequence text = mInput.getText();
                Logger.i( CommonCode.collectNotFormsSymbolsPunctuationString( text ).toString() );
            }
        } );
    }
}